package com.example.trb.util.result;

import org.springframework.http.HttpStatus;

public enum SysReturnCode implements ReturnCode {
    REQUEST_TIMEOUT(HttpStatus.REQUEST_TIMEOUT.value(), "请求超时，请检查网络状态后重试"),
    OK(HttpStatus.OK.value(), "请求成功"),
    INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR.value(), "服务器出错"),
    REQUEST_ARGUMENT_ERROR(HttpStatus.NOT_ACCEPTABLE.value(), "请求的参数错误"),
    BAD_REQUEST(HttpStatus.BAD_REQUEST.value(), "请求出错"),
    NO_FOUND(HttpStatus.NOT_FOUND.value(), "No Found");

    public final int code;
    public final String message;

    SysReturnCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
